package net.zjitc.controller;

import net.zjitc.pojo.Category;
import net.zjitc.service.CategoryService;
import net.zjitc.service.impl.CategoryServiceImpl;
import net.zjitc.utils.dispacher.URLMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Created by Administrator on 2017/12/4.
 */
public class IndexController {
    CategoryService categoryService = new CategoryServiceImpl();
    @URLMapping(url = "/index")
    public String index(HttpServletRequest request, HttpServletResponse response){
        //准备数据  1. 一级分类  2. 热销商品  3. 最新商品
        List<Category> clist = categoryService.findAll();
        request.setAttribute("clist",clist);

        //

        //

        return "/WEB-INF/user/index.jsp";
    }
}
